﻿using System;
using System.Collections.Generic;
using System.Text;
using FAP.DataAccess;
using FAP.DataAccess.BLL;


namespace FapCore
{
    public enum FieldType
    {
        UNIQUE,
        DEFAULT,
        REALTIME

    }

    public enum DataType
    {
        Email,
        Other
        
    }
    public class Field
    {
        private string fieldName;

        public string FieldName
        {
            get { return fieldName; }
            set { fieldName = value; }
        }
        private FieldType fieldType;

        public FieldType FieldType
        {
            get { return fieldType; }
            set { fieldType = value; }
        }
        private DataType dataType;

        public DataType DataType
        {
            get { return dataType; }
            set { dataType = value; }
        }
        private string defaultValue;

        public string DefaultValue
        {
            get { return defaultValue; }
            set { defaultValue = value; }
        }
        private int step;//temporary

        public int Step
        {
            get { return step; }
            set { step = value; }
        }
       
    }
    public static class Converter
    {
        public static List<chitietbuocthuchien> ConvertStringToField(String str)
        {
            List<chitietbuocthuchien> fields = new List<chitietbuocthuchien>();
            String[] strArray = str.Split('&');
            foreach (String s in strArray)
            {
                chitietbuocthuchien f = new chitietbuocthuchien();
                String[] strIs = s.Split('=');
                f.tenfield = strIs[0];
                f.dulieumacdinh = strIs[1];
                fields.Add(f);

            }
            return( fields.Count > 0 ? fields : null);

        }

    }
}
